$(function(){
	//列表
	$(".list").wrapAll("<div class='list_wrap'></div>");
	$(".summary").wrapAll("<div class='summary_wrap'></div>"); 
	//窗口自适应大小判断
	if($(".iframe_area iframe").length != 0){
		var iframe_off = $(".iframe_area iframe").offset().top;
	};
	if( $(".chart").length !=0){
		var chart_off = $(".chart dd").offset().top;
	};
	var body_h;
	var iframe_body_h;
	var footer_h = $(".footer").outerHeight(true);
	var page_h =$(".page").outerHeight(true);
	var resize = function(){
		body_h = $("body").height();
		$(".chart_bg dd").css("height",body_h - chart_off- footer_h - 59);
		$(".summary_wrap,.list_wrap").css({"height":body_h - page_h-15});
		$(".iframe_area").css({"height":body_h - iframe_off - footer_h});
		if($(".list_wrap").height() < $(".list").height()){
			$(".list_wrap").css({"border-top":"1px solid #b9d3d7","border-bottom":"1px solid #b9d3d7"});
			$(".list").css({"width":$(".list_wrap").width()-17});
		}else{
			$(".list_wrap").css("border","none");
			$(".list").css({"width":"100%"})
		};
	};
	$(window).resize(function(){
		resize();
	});
	resize();
	//首页图表区域圆角自适应
	$(".chart").wrapAll("<div class='chart_wrap'></div>").before("<div class='t'><div class='t_l'></div><div class='t_r'></div></div>").after("<div class='b'><div class='b_l'></div><div class='b_r'></div></div>");
	//折叠搜索框区域
	$(".puck").click(function(){
		$(".sear tr").toggle();	
		if($(this).attr("src") == "../images/icon_down.gif"){
			$(".iframe_area").css({"height":$(".iframe_area").height()+40});
		}else{
			$(".iframe_area").css({"height":$(".iframe_area").height()-40})
		};
	});
	//折叠排序
	$(".bar").click(function(){
		$(".px").closest("td").toggle();
		if($(this).attr("src") == "../images/bar_close.gif"){
			$(this).attr("src","../images/bar_open.gif");	
		}else{
			$(this).attr("src","../images/bar_close.gif");	
		};
	});
	//按钮光标事件
	$("input:button").hover(function(){
		var className = this.className;
		$(this).removeClass().addClass(className + "_over")
	},function(){
		var className = this.className;
		var className_off = this.className.substring(0,5);
		$(this).removeClass(className).addClass(className_off)
	});
	//列表行接触、点击、隔行同色事件
	$(".list tr:even").addClass("even");
	$(".list tr").each(function(){
		var class_name = this.className;
		$(this).hover(function(){
			this.className = "over";		 
		},function(){
			this.className = class_name;			 
		});
	});
	$(".px li:last").css({"border-bottom":"none","text-align":"center","padding-top":"10px"});
	$(".system_intro dd:first").css("background","none")
})